//! Tests.debug.js
//

(function() {

Type.registerNamespace('Tests.Classes');

////////////////////////////////////////////////////////////////////////////////
// Tests.Classes.TestPageTests

Tests.Classes.TestPageTests = function Tests_Classes_TestPageTests() {
    /// <field name="_gigActionTestPassed" type="String" static="true">
    /// </field>
}
Tests.Classes.TestPageTests.GigActionTest = function Tests_Classes_TestPageTests$GigActionTest(gg, gd) {
    /// <param name="gg" type="Gig">
    /// </param>
    /// <param name="gd" type="WhirliGig.Classes.GigData">
    /// </param>
    Tests.Classes.TestPageTests._gigActionTestPassed = gd.testdata;
    var tst = gg.element.find(Gig.dotGigContentClassName);
    tst.html(Tests.Classes.TestPageTests._gigActionTestPassed).addClass('GigActionTest1');
    window.setTimeout(Tests.Classes.TestPageTests.GigActionVerify, 1);
}
Tests.Classes.TestPageTests.GigActionVerify = function Tests_Classes_TestPageTests$GigActionVerify() {
    var tst = $('.GigActionTest1');
    var result = tst.html();
    tst = tst.closest(Gig.dotGigClassName);
    if (!String.isNullOrEmpty(result) && result === Tests.Classes.TestPageTests._gigActionTestPassed) {
        tst.css({ color: '#0A0', 'background-color': 'rgba(150,150,150,.25)' });
    }
    else {
        tst.css({ color: '#A00', 'background-color': 'rgba(150,150,150,.25)' });
    }
}


Type.registerNamespace('MetaTests.Pages');

////////////////////////////////////////////////////////////////////////////////
// MetaTests.Pages.BlankTest

MetaTests.Pages.BlankTest = function MetaTests_Pages_BlankTest() {
    /// <field name="suiteName" type="String" static="true">
    /// </field>
    /// <field name="instance" type="MetaTests.Pages.BlankTest" static="true">
    /// </field>
    MetaTests.Pages.BlankTest.initializeBase(this, [ 'BlankTest' ]);
    var test1 = new Test('BlankTest 1').addToSuite(this).actionDx(function(aw) {
    });
    new Test(TestSuite.allTestsName).addToSuite(this).goTo(ThemeYoshi.defaultPageName).call(test1);
}


////////////////////////////////////////////////////////////////////////////////
// MetaTests.Pages.DragDropTests

MetaTests.Pages.DragDropTests = function MetaTests_Pages_DragDropTests() {
    /// <field name="suiteName" type="String" static="true">
    /// </field>
    /// <field name="instance" type="MetaTests.Pages.DragDropTests" static="true">
    /// </field>
    MetaTests.Pages.DragDropTests.initializeBase(this, [ MetaTests.Pages.DragDropTests.suiteName ]);
    var image1 = 'http://www.noticiasdot.com/wp2/wp-content/uploads/2007/05/mario-yoshi.jpg';
    var gig1;
    var gig = '#{0}';
    var cover = '#{0} .Cover';
    var tilter = '#{0} .Tilter';
    var gearBtn = '#{0} .TheGear';
    var delBtn = '.GigMu .Tab:contains(remove)';
    var pasteItem = new Test('Paste an item').addToSuite(this).actionDx(function(aw) {
        var gse = Test.getInstance(GigShowEdit);
        var url = aw.get_item('@url');
    });
    var dragItem = new Test('Drag current item').addToSuite(this).actionDx(function(aw) {
        var top = aw.get_item('top');
        var left = aw.get_item('left');
        var ge = Test.getInstance(GigEdit);
        ge.element.css({ top: top, left: left });
    });
    var deleteItem = new Test('Paste current item').addToSuite(this).mouseOver('@cover').waitFor('@tilter').press('@gearBtn').press('@delBtn').press(Test.askOkBtn).waitNot('@gig');
    new Test(TestSuite.allTestsName).addToSuite(this).goTo(ThemeYoshi.defaultPageName).call(pasteItem, { '@url': image1 }).call(dragItem, { top: -100, left: 700 }).call(dragItem, { top: 300, left: 200 }).delay(5000).call(deleteItem);
}


////////////////////////////////////////////////////////////////////////////////
// MetaTests.Pages.MasterPageTests

MetaTests.Pages.MasterPageTests = function MetaTests_Pages_MasterPageTests() {
    /// <field name="suiteName" type="String" static="true">
    /// </field>
    /// <field name="instance" type="MetaTests.Pages.MasterPageTests" static="true">
    /// </field>
    MetaTests.Pages.MasterPageTests.initializeBase(this, [ MetaTests.Pages.MasterPageTests.suiteName ]);
    var savedUser = '@SavedUser';
    var savedPage = '@SavedPage';
    new Test(TestSuite.allTestsName).addToSuite(this).set(savedPage, function() {
        return ThemeYoshi.currentPageName;
    }).goTo(savedPage);
}


Tests.Classes.TestPageTests.registerClass('Tests.Classes.TestPageTests');
MetaTests.Pages.BlankTest.registerClass('MetaTests.Pages.BlankTest', TestSuite);
MetaTests.Pages.DragDropTests.registerClass('MetaTests.Pages.DragDropTests', TestSuite);
MetaTests.Pages.MasterPageTests.registerClass('MetaTests.Pages.MasterPageTests', TestSuite);
Tests.Classes.TestPageTests._gigActionTestPassed = '';
MetaTests.Pages.BlankTest.suiteName = 'BlankTest';
MetaTests.Pages.BlankTest.instance = new MetaTests.Pages.BlankTest();
MetaTests.Pages.DragDropTests.suiteName = ThemeYoshi.defaultPageName;
MetaTests.Pages.DragDropTests.instance = new MetaTests.Pages.DragDropTests();
MetaTests.Pages.MasterPageTests.suiteName = ThemeYoshi.defaultPageName;
MetaTests.Pages.MasterPageTests.instance = new MetaTests.Pages.MasterPageTests();
})();

//! This script was generated using Script# v0.7.4.0
